﻿using System;
using System.Collections.Generic;
using LinqSpecs;
using PCE.Domain;

namespace PCE.Data
{
	public interface IRepository<TEntity, in TKey> 
		where TEntity : Entity<TKey>
		where TKey : IEquatable<TKey>
	{
		TEntity Get(TKey key);

		void Save(TEntity entity);

		TEntity Find(Specification<TEntity> spec);

		IEnumerable<TEntity> FindAll(Specification<TEntity> spec);

		int Count(Specification<TEntity> spec);
	}
}